-
Notifications
You must be signed in to change notification settings - Fork 6.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[openxlsx] Add new port #41150
base: master
Are you sure you want to change the base?
[openxlsx] Add new port #41150
Conversation
@microsoft-github-policy-service agree |
Why add CMakeLists.txt for libxml? It's already provided upstream. |
New port
Then run
The modification needs to meet the requirements: maintainer-guide |
Reminder: The version file is missing. Please refer to: 39493/files. |
This reverts commit ea61266.
@MonicaLiu0311 Thank you very much for all your insightful comments, I really appreciate them, I updated the fork with your suggested changes ( according to my best understanding). Please let me know if you have further comments, and please be patient with me). Thank you again |
When testing usage, the following error occurs:
test.cpp#include <iostream> #include "OpenXLSX.hpp" CMakeLists.txtcmake_minimum_required (VERSION 3.8) |
@MonicaLiu0311 Thank you very much that is fixed now. I have a question, if you dont mind please reply to them.
Thank you again for your patience. I hope to become a regular contributor to vcpkg |
The regular expression for |
Notes: the patch file is to fix a compilation error in vs2019, 2022, this was already fixed in the master but not committed to the latest release
@MonicaLiu0311 Thank you very much for your comments, I added the changes you recommended. I, now, have two new questions.
Thank you for your patience |
This now works, but please note that to be able to use openxlsx in the cmakelists.txt file one has to add the following line set(CMAKE_CXX_STANDARD 17) as the some of the header files are dependent on c++17, should that be mentioned in the usage file in one way or the other? |
No.
This indicates that the tags are named
Yes. The SHA512 is to verify the downloaded archive, and it is also used as an source asset cache key.
If there is exported CMake config, the C++17 requirement could be in the exported compile features. |
ports/openxlsx/portfile.cmake
Outdated
SHA512 52205b394383d45c0fb16599ab96453d8a5b9b5cd596096848cc888f47565b2713d9edded06b2ecd7b67736622badf136e4b1becc57bfa5bbdcb1e063a347084 | ||
HEAD_REF master | ||
PATCHES | ||
compilation_fix.patch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit-pick:
compilation_fix.patch | |
compilation_fix.patch |
ports/openxlsx/portfile.cmake
Outdated
set(CMAKE_CXX_STANDARD 17) | ||
|
||
vcpkg_cmake_configure( | ||
SOURCE_PATH ${SOURCE_PATH} | ||
PREFER_NINJA | ||
OPTIONS | ||
-DOPENXLSX_BUILD_TESTS=OFF | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
set(CMAKE_CXX_STANDARD 17) | |
vcpkg_cmake_configure( | |
SOURCE_PATH ${SOURCE_PATH} | |
PREFER_NINJA | |
OPTIONS | |
-DOPENXLSX_BUILD_TESTS=OFF | |
) | |
vcpkg_cmake_configure( | |
SOURCE_PATH ${SOURCE_PATH} | |
PREFER_NINJA | |
OPTIONS | |
-DCMAKE_CXX_STANDARD=17 | |
-DOPENXLSX_BUILD_TESTS=OFF | |
) |
Portfiles run in script mode. CMAKE_CXX_STANDARD
has no effect.
https://learn.microsoft.com/en-us/vcpkg/contributing/maintainer-guide#portfiles-are-run-in-script-mode
ports/openxlsx/portfile.cmake
Outdated
|
||
vcpkg_cmake_configure( | ||
SOURCE_PATH ${SOURCE_PATH} | ||
PREFER_NINJA |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PREFER_NINJA |
Default.
ports/openxlsx/portfile.cmake
Outdated
OPTIONS | ||
-DOPENXLSX_BUILD_TESTS=OFF | ||
) | ||
vcpkg_cmake_install(DISABLE_PARALLEL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why DISABLE_PARALLEL
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is not needed, nice catch, thank you very much
@dg0yt thank you very much for your comments, I really appreciate all of them, I have replied to them to the best of my knowledge. Please accept my apologies for taking too much of your time, this is my first contribution to vcpkg |
Co-authored-by: Kai Pastor <dg0yt@darc.de>
@MonicaLiu0311 Thank you very much for all your help and comments, now that all tests have passed is the pull request ok now? |
@MonicaLiu0311 @dg0yt is there anything else I need to do? |
The usage test passed on
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Partial Review:
It looks like this port is vendoring dependencies. All the ports dependencies should be explicitly listed in the dependency section of the vcpkg.json
.
@@ -0,0 +1,30 @@ | |||
# Header-only library |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Header-only library | |
# Header-only library | |
set(VCPKG_BUILD_TYPE release) |
vcpkg_cmake_install() | ||
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/OpenXLSX) | ||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") | ||
file(COPY "${SOURCE_PATH}/OpenXLSX/external" DESTINATION "${CURRENT_PACKAGES_DIR}/include") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
External? It looks like this is vending zippy
, pugixml
, and nowide
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JavierMatosD one of the dependencies (zippy) is not in vcpkg, should it be added to vcpkg, in a separate port as a requirement for this port?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Please open another PR adding zippy
as a port as it is a requirement for this port.
{ | ||
XLQuery query(XLQueryType::QuerySheetVisibility); | ||
- query.template setParam("sheetID", relationshipID()); | ||
+ query.setParam("sheetID", relationshipID()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this patch needed? Has it been reported upstream?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JavierMatosD Yes, it has been fixed in the upstream but it has not been put in the release refs yet, it is in the master (main ) branch, however.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this patch is already fixed upstream, can you download and apply the patch directly instead of checking it in?
Co-authored-by: Javier Matos Denizac <javier.matosd@gmail.com>
Co-authored-by: Javier Matos Denizac <javier.matosd@gmail.com>
Fixes #40931
find_package
calls are REQUIRED, are satisfied byvcpkg.json
's declared dependencies, or disabled with CMAKE_DISABLE_FIND_PACKAGE_Xxx.vcpkg.json
matches what upstream says.vcpkg.json
matches what upstream says../vcpkg x-add-version --all
and committing the result.